Skip to content

Conversation

maxbeatty
Copy link
Member

closes #309

This is the easier approach to allowing a code snippet to be removed although it would be nice to have a button or something. All of the server logic is already in place to deal with a deletion this way.

@@ -21,7 +21,7 @@ exports.testPage = Joi.object().keys({
setup: mediumText,
teardown: mediumText,
test: Joi.array().required().min(2).items(Joi.object().required().keys({
title: Joi.string().required().trim().allow('').empty('').max(255).when('code', {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

required and allow('') apparently don't mix

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hah! Good catch!

@mathiasbynens
Copy link
Contributor

LGTM with build failure addressed

@maxbeatty
Copy link
Member Author

Turns out this was more complicated because of the circular dependencies in Joi (hapijs/joi#588 hapijs/joi#1236). Added more tests to verify behavior.

@mathiasbynens mathiasbynens merged commit b8fe760 into master Jul 11, 2017
@mathiasbynens mathiasbynens deleted the rm-snippet branch July 11, 2017 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow a code snippet to be removed
2 participants